﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ciripescu_WebRole.BL;
using Ciripescu_WebRole.Entities;

namespace Ciripescu_WebRole
{
    public partial class comments : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnAddComment_Click(object sender, EventArgs e)
        {
            CommentManager cm = new CommentManager();
            Comment c = new Comment("", txtContent.Text);
            c.Name = txtName.Text;
            c.Email = txtEmail.Text;
            c.Url = txtUrl.Text;
            c.IP = Request.UserHostAddress;
            c.IsAproved = true;
            c.Date = DateTime.Now;
            
            cm.Insert(c);
            ListView1.DataBind();
        }
    }
}
